a=int(input())
b=input().strip()
qq=''
t=[]
for i in range(a):
  for j in range(i,a):                                                                                                                                 
    if b[j] not in qq:
        qq=qq+b[j]
    else:
       t.append(qq)
       qq=''
       break
dic = {"l": 10, "la": 20, "lan": 30, "lanq": 40,"lanqi": 50, "lanqio": 60, "lanqiob": 70, "lanqiobe": 80}
keys=dic.keys()

ff=0
max1=0
h=''
for i in t:
  aaa = sum(ord(j) - ord('a') + 1 for j in i)
  ff=0
  for j in keys:
    if j in i:
      ff=dic[j]
  sum1=ff+aaa
  if max1<sum1:
    max1=sum1
    h=i
  elif max1==sum1 and i<h:
      h=i

print(h)